using System;
using NUnit.Framework;
using Sanelib.Common.Helpers;

namespace UnitTest.Common
{
    [TestFixture]
    public class SystemTimeTester
    {
        [Test]
        public void ReturnsCurrentDateTime()
        {
            var currentDateTime = DateTime.Now;
            var systemTime = SystemTime.Now();
            var value = systemTime - currentDateTime;
            Assert.Less(value, new TimeSpan(5));
        }

        [Test]
        public void ReturnsDelegate()
        {
            var func = SystemTime.Now;
            Assert.NotNull(func);
            Assert.AreEqual(func().GetType(), typeof (DateTime));
        }
    }
}